#ifndef LEETCODE_CN_CPP_PROBLEMS_746_H
#define LEETCODE_CN_CPP_PROBLEMS_746_H

#include <vector>

using namespace std;

namespace problem_746
{

class Solution
{
public:
    int minCostClimbingStairs(vector<int> &cost)
    {
        for (int i = 2; i < cost.size(); ++i)
        {
            cost[i] += min(cost[i - 1], cost[i - 2]);
        }
        return min(cost[cost.size() - 1], cost[cost.size() - 2]);
    }
};

} // namespace problem_746

#endif //LEETCODE_CN_CPP_PROBLEMS_746_H
